<template>
  <div class="con">
    <img class="logo" src="@/assets/headerimg.png" alt />
    <slot />
    <router-link to="/home" class="my" v-if="!isTrue">
      <i class="iconfont icon-menu"></i>
    </router-link>
    <router-link to="/user" class="my" v-else>
      <img
        :src="user.headerimg?user.headerimg:`${$store.state.defaulheaderturl}user/user.jpg`"
        class="userheader"
      />
    </router-link>

    <!-- <div class="outline" @click="outLogin">
      <i class="el-icon-s-unfold"></i>
    </div>-->
  </div>
</template>

<script>

export default {
  data() {
    return {
      user: {},
    };
  },
props:["isTrue"],
  created() {
    this.user = JSON.parse(window.sessionStorage.getItem("user"));
  },
  methods: {

  },
};
</script>

<style lang="less" scoped>
.con {
  padding: 0 30px;
  height: 90px;
  background-color:rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  .my {
    height: 50px;

    img {
      height: 50px;
      width: 50px;
      border-radius: 50%;
      border: 1px solid #fff;
    }
    i {
      font-size: 40px;
      color: #fff;
    }
  }
  .logo {
    height: 70px;
  }
}
</style>